<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<img id="img" width="600px" height="400px" />
	</body>
	<script>
	var img=document.getElementById("img");
	// 图片路径保存
	imgSrc=[
		"img/11.jpg",
		"img/12.png",
		"img/13.jpg",
		"img/14.jpg",
		"img/15.jpg",
		"img/16.jpg",
		"img/17.jpg"		
	]
	var index=0
	window.setInterval(function(){
		img.src=imgSrc[index]
		index++
		// 如果index值为数组的最大长度
		if(index==imgSrc.length){
			index=0
		}
	},1000)
	
	</script>
</html>
